package com.example.smartcity_poverty.ui.SmartSubject.AllSubjectActivity.PovertyActivity.fragment.poverty.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.MenuItem
import com.example.smartcity_poverty.R
import kotlinx.android.synthetic.main.activity_four_show.*

/**
 * 案例发布文章详情
 */
class FourShowActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        supportActionBar?.setDisplayHomeAsUpEnabled(true)
        setContentView(R.layout.activity_four_show)
        title = "案例文章详情"

        val image = intent.getIntExtra("image", 0)
        val title = intent.getStringExtra("title")
        val content = intent.getStringExtra("content")

        title?.let {
            fourShowTitle.text = title
        }
        image.let {
            fourShowImage.setImageResource(image)
        }
        content?.let {
            fourShowContent.text = content
        }

    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        finish()
        return super.onOptionsItemSelected(item)
    }
}